<?php
 /******************************************************************************
 *   GunCMS is an avid supporter of open source software. This is the appropriate 
 *   option if you are creating an open source application with a license 
 *   compatible with the GNU GPL license v3.
 *   For details http://www.gnu.org/licenses/gpl.html
 *   DO NOT USE FOR COMMERCIAL WITHOUT PERMISSION
 *
 * GunCMS Version 1.0.3
 * Copyright(c) 2009-2010, T & L GdbR
 * info@guncms.de
 * 
 * http://www.guncms.de
 ********************************************************************************/
// No definitions, because the user is only important for the 
// administration pages.
		$activelang = FgcmsMultiLanguageBean::get_active_lang($db,'1');
		if($activelang->lang_active == '1'){
			if(!isset($_SESSION["LC_ALL"]))
				$_SESSION["LC_ALL"] = 'en';
			$getlang = FgcmsMultiLanguageBean::getnamelang_bykeylang($_SESSION["LC_ALL"]);
			$smarty->assign("GETLANG", $getlang);
			$list_lang = FgcmsMultiLanguageBean::get_list_lang($db);
			if($list_lang!=""){
				foreach($list_lang as $item){
					if($item->flags!="")
						$item->img=UPLOAD_FLAG.$item->flags;
				}
			}	
			$smarty->assign("LANGUAGE", $list_lang);
			$smarty->assign("ACTIVELANG", $activelang->lang_active);
			if(isset($_POST['namelang']) && $_POST['namelang']!='')
			{
				$_SESSION['LC_ALL']=$_POST['namelang'];		
				header("Location: ./".$_POST['returnpage']);		
			}
		}else{
			$_SESSION["LC_ALL"] = $activelang->key_lang;
		}
	
	function do_translation ($params, $content, &$smarty, &$repeat) {
		if (isset($content)) {
			return FgcmsMultiLanguageBean::changelang($content); 
		} 
	}
	$smarty->register_block("TranslateTag", "do_translation");
	
?>
